home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cbibcode.arc
/
FGETS.C
< prev
next >
Wrap
Text File
|
1991-08-05
|
459b
|
20 lines
/* fgets.c */
#include <stdio.h>
main()
{
FILE *infile;
char string[81];
/* Open the file. Because of the special significance
* of '\' in C, we need two of them in the path name for
* autoexec.bat */
if ((infile = fopen("c:\\autoexec.bat", "r")) == NULL)
{
printf("fopen failed.\n");
exit(0);
}
printf ("Contents of c:autoexec.bat:\n");
while (fgets(string, 80, infile) != NULL)
{
fputs(string,stdout);
}
}